package SVNTest;

import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

public class FirstSVNTest {
	public Selenium selenium;
	
	@BeforeTest	
	public void setUpTest() throws Exception{		
		/*selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://public.staging.zumba.com/");*/		
		selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.zumba.com/");
		selenium.start();
		selenium.windowMaximize();
	}	
  @Test
  public void US_Guest_Shop() throws Exception {
		selenium.open("/en-US");
		waitTime(10000);
		selenium.click("//a[3]");
		selenium.waitForPageToLoad("6000");
		assertTrue(selenium.getText("//div[@id='layout-page-content']/div[3]").matches("^Hello Gorgeous! Sign In or Sign Up\n Email or Username Email or username is required\\. \n Password Forgot password[\\s\\S] Required field \n Sign In OR\n Login with Facebook$"));
		selenium.click("link=Sign Up");
		assertTrue(selenium.getText("//div[@id='layout-page-content']/div[3]").matches("^Join the Party! Sign Up or Sign In\n [\\s\\S]*Required fields\n First Name[\\s\\S]* First name is required\\. \n Last Name[\\s\\S]* Last name is required\\. \n Email[\\s\\S]* This field should be a valid email and is required \n Username[\\s\\S]* Username is required, and must have only letters \\(A-Z\\), dash \\(-\\), and dot \\(\\.\\), with no spaces\\. \n Choose a password[\\s\\S]* Password must be at least 8 characters long \n Confirm Password[\\s\\S]* Your passwords don't match \n I would like to receive occasional email updates from Zumba\\. \n I agree to the Zumba Terms of Use [\\s\\S]* Please agree to the Zumba Terms of Use \n Create Account We never sell your personal information\\.\n Read our privacy policy$"));

		System.out.println("========================================");
		
		/*selenium.click("//button[@type='submit']");
		waitTime(10000);
		selenium.click("//button");
		waitTime(60000);
		String OrderNumber = selenium.getText("css=h2.ch-number");
		System.out.println(OrderNumber);*/
		}
	@AfterTest
	public void endTest(){	
		//selenium.close();
	}
	private void assertTrue(boolean matches) {
	// TODO Auto-generated method stub
	
}
	public static void waitTime(int Time) throws Exception
	{
		Thread.sleep(Time);
	}
}
